<!DOCTYPE html>
<html class="sidebar_default no-js" lang="en">
    <head>
    <meta charset="utf-8">
    <title>Maps - Start - Admin Template</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="css/images/favicon.png">
    <!-- Le styles -->
    <link href="css/twitter/bootstrap.css" rel="stylesheet">
    <link href="css/base.css" rel="stylesheet">
    <link href="css/twitter/responsive.css" rel="stylesheet">
    <link href="css/jquery-ui-1.8.23.custom.css" rel="stylesheet">
    <style>
#gmap3 {
  text-align: center;
}
.gmap3 {
  margin: 20px auto;
  border: 1px dashed #C0C0C0;
  width: 1000px;
  height: 750px;
}
.cluster {
  color: #FFFFFF;
  text-align: center;
  font-family: 'Arial, Helvetica';
  font-size: 11px;
  font-weight: bold;
}
.cluster-1 {
  background-image: url(img/maps/m1.png);
  line-height: 53px;
  width: 53px;
  height: 52px;
}
.cluster-2 {
  background-image: url(img/maps/m2.png);
  line-height: 53px;
  width: 56px;
  height: 55px;
}
.cluster-3 {
  background-image: url(img/maps/m3.png);
  line-height: 66px;
  width: 66px;
  height: 65px;
}
</style>
    <script src="js/plugins/modernizr.custom.32549.js"></script>
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="../../../html5shim.googlecode.com/svn/trunk/html5.js"></script>
      <![endif]-->
    </head>

    <body>
<div id="loading"><img src="img/ajax-loader.gif"></div>
<div id="responsive_part">
      <div class="logo"> <a href="index.html"><span>Start</span><span class="icon"></span></a> </div>
      <ul class="nav responsive">
    <li>
          <button class="btn responsive_menu icon_item" data-toggle="collapse" data-target=".overview"> <i class="icon-reorder"></i> </button>
        </li>
  </ul>
    </div>
<!-- Responsive part -->

<div id="sidebar" class=" collapse1 in">
      <div class="scrollbar">
    <div class="track">
          <div class="thumb">
        <div class="end"></div>
      </div>
        </div>
  </div>
      <div class="viewport ">
    <div class="overview collapse">
          <div class="search row-fluid container">
        <h2>Search</h2>
        <form class="form-search">
              <div class="input-append">
            <input type="text" class=" search-query" placeholder="">
            <button class="btn_search color_4">Search</button>
          </div>
            </form>
      </div>
          <ul id="sidebar_menu" class="navbar nav nav-list container full">
        <li class="accordion-group  color_4"> <a class="dashboard " href="index.html"><img src="img/menu_icons/dashboard.png"><span>Dashboard</span></a> </li>
        <li class="accordion-group color_7"> <a class="accordion-toggle widgets collapsed " data-toggle="collapse" data-parent="#sidebar_menu" href="#collapse1"> <img src="img/menu_icons/forms.png"><span>Form Elements</span></a>
              <ul id="collapse1" class="accordion-body collapse">
            <li><a href="forms_general.html">General</a></li>
            <li><a href="forms_validation.html">Validation</a></li>
            <li><a href="forms_editor.html">Editor</a></li>
          </ul>
            </li>
        <li class="accordion-group color_3"> <a class="accordion-toggle widgets collapsed" data-toggle="collapse" data-parent="#sidebar_menu" href="#collapse2"> <img src="img/menu_icons/widgets.png"><span>UI Widgets</span></a>
              <ul id="collapse2" class="accordion-body collapse">
            <li><a href="ui_buttons.html">Buttons</a></li>
            <li><a href="ui_dialogs.html">Dialogs</a></li>
            <li><a href="ui_icons.html">Icons</a></li>
            <li><a href="ui_tabs.html">Tabs</a></li>
            <li><a href="ui_accordion.html">Accordion</a></li>
          </ul>
            </li>
        <li class="color_13 "> <a class="widgets" href="calendar2.html"> <img src="img/menu_icons/calendar.png"><span>Calendar</span></a> </li>
        <li class="color_10 active"> <a class="widgets"data-parent="#sidebar_menu" href="maps.html"> <img src="img/menu_icons/maps.png"><span>Maps</span></a> </li>
        <li class="accordion-group color_12"> <a class="accordion-toggle widgets collapsed" data-toggle="collapse" data-parent="#sidebar_menu" href="#collapse3"> <img src="img/menu_icons/tables.png"><span>Tables</span></a>
              <ul id="collapse3" class="accordion-body collapse">
            <li><a href="tables_static.html">Static</a></li>
            <li><a href="tables_dynamic.html">Dynamics</a></li>
          </ul>
            </li>
        <li class="accordion-group color_19"> <a class="accordion-toggle widgets collapsed" data-toggle="collapse" data-parent="#sidebar_menu" href="#collapse4"> <img src="img/menu_icons/statistics.png"><span>Charts</span></a>
              <ul id="collapse4" class="accordion-body collapse">
            <li><a href="statistics.html">Statistics Elements</a></li>
            <li><a href="charts.html">Charts</a></li>
          </ul>
            </li>
        <li class="color_24"> <a class="widgets"data-parent="#sidebar_menu" href="grid.html"> <img src="img/menu_icons/grid.png"><span>Grid</span></a> </li>
        <li class="color_8"> <a class="widgets"data-parent="#sidebar_menu" href="media.html"> <img src="img/menu_icons/gallery.png"><span>Media</span></a> </li>
        <li class="color_4"> <a class="widgets"data-parent="#sidebar_menu" href="file_explorer.html"> <img src="img/menu_icons/explorer.png"><span>File Explorer</span> <span class="label  label-info pull-right">new</span></a> </li>
        <li class="accordion-group color_25"> <a class="accordion-toggle widgets collapsed" data-toggle="collapse" data-parent="#sidebar_menu" href="#collapse5"> <img src="img/menu_icons/others.png"><span>Specific Pages</span></a>
              <ul id="collapse5" class="accordion-body collapse">
            <li><a href="profile.html">Profile</a></li>
            <li><a href="search.html">Search</a></li>
            <li><a href="index2.html">Login</a></li>
            <li><a href="404.html">404 Error</a></li>
          </ul>
            </li>
      </ul>
          <div class="menu_states row-fluid container ">
        <h2 class="pull-left">Menu Settings</h2>
        <div class="options pull-right">
              <button id="menu_state_1" class="color_4" rel="tooltip" data-state ="sidebar_icons" data-placement="top" data-original-title="Icon Menu">1</button>
              <button id="menu_state_2" class="color_4 active" rel="tooltip" data-state ="sidebar_default" data-placement="top" data-original-title="Fixed Menu">2</button>
              <button id="menu_state_3" class="color_4" rel="tooltip" data-placement="top" data-state ="sidebar_hover" data-original-title="Floating on Hover Menu">3</button>
            </div>
      </div>
          <!-- End sidebar_box --> 
          
        </div>
  </div>
    </div>
<div id="main">
      <div class="container">
    <div class="header row-fluid">
          <div class="logo"> <a href="index.html"><span>Start</span><span class="icon"></span></a> </div>
          <div class="top_right">
        <ul class="nav nav_menu">
              <li class="dropdown"> <a class="dropdown-toggle administrator" id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="../../page.html">
                <div class="title"><span class="name">George</span><span class="subtitle">Future Buyer</span></div>
                <span class="icon"><img src="img/thumbnail_george.jpg"></span></a>
            <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
                  <li><a href="profile.html"><i class=" icon-user"></i> My Profile</a></li>
                  <li><a href="forms_general.html"><i class=" icon-cog"></i>Settings</a></li>
                  <li><a href="index2.html"><i class=" icon-unlock"></i>Log Out</a></li>
                  <li><a href="search.html"><i class=" icon-flag"></i>Help</a></li>
                </ul>
          </li>
            </ul>
      </div>
          <!-- End top-right --> 
        </div>
    <div id="main_container">
          <div class="row-fluid">
        <div class=" span6">
              <div class="box color_10 paint">
            <div class="title">
                  <div class="row-fluid">
                <h4> Basic Maps </h4>
              </div>
                </div>
            <!-- End .title -->
            <div class="content">
                  <div id="gmap1" style="height:300px; width:100%"></div>
                </div>
            <!-- End .content --> 
          </div>
              <!-- End .span6 --> 
            </div>
        <!--  .box -->
        
        <div class=" span6">
              <div class="box paint color_2">
            <div class="title">
                  <div class="row-fluid">
                <h4> Geolocation (your address) </h4>
              </div>
                </div>
            <!-- End .title -->
            <div class="content">
                  <div id="gmap2" style="height:300px; width:100%"></div>
                </div>
            <!-- End .content --> 
          </div>
              <!-- End .span6 --> 
            </div>
        <!-- End  .box --> 
      </div>
          <!-- End .row-fluid -->
          <div class="row-fluid">
        <div class=" span6">
              <div class="box paint_hover">
            <div class="title">
                  <div class="row-fluid">
                <h4> Clustered Maps <small class="muted">click to add new markers to the cluster</small> </h4>
              </div>
                </div>
            <!-- End .title -->
            <div class="content">
                  <div id="gmap3" style="height:300px; width:100%"></div>
                </div>
            <!-- End .content --> 
          </div>
              <!-- End .box --> 
            </div>
        <!-- End .span6 -->
        
        <div class="span6">
              <div class="box paint_hover color_24">
            <div class="title">
                  <div class="row-fluid">
                <div class="span8">
                      <h4> Address </h4>
                    </div>
                <div class="pull-right right_offset span4">
                      <div class="input-append  btn-toolbar pull-right">
                    <input type="text" id="test-address" style="width:180px" placeholder="Type a location..">
                    <button type="submit" class="btn btn-info" id="test-ok">Add Pin</button>
                  </div>
                    </div>
              </div>
                </div>
            <!-- End .title -->
            <div class="content">
                  <div id="gmap4" style="height:275px; width:100%"></div>
                </div>
            <!-- End .content -->
            <div class="description"> Fill in an address and a marker will be added. </div>
          </div>
              <!-- End .box --> 
            </div>
        <!-- End .span6  --> 
      </div>
          <!-- End .row-fluid --> 
          
        </div>
    <!-- End #container --> 
  </div>
      <div id="footer">
    <p> &copy; Start - Admin Template 2012 </p>
    <span class="company_logo"><a href="../../../www.pixelgrade.com/default.htm"></a></span> </div>
    </div>
<div class="background_changer dropdown">
      <div class="dropdown" id="colors_pallete"> <a data-toggle="dropdown" data-target="drop4" class="change_color"></a>
    <ul  class="dropdown-menu pull-left" role="menu" aria-labelledby="drop4">
          <li><a data-color="color_0" class="color_0" tabindex="-1">1</a></li>
          <li><a data-color="color_1" class="color_1" tabindex="-1">1</a></li>
          <li><a data-color="color_2" class="color_2" tabindex="-1">2</a></li>
          <li><a data-color="color_3" class="color_3" tabindex="-1">3</a></li>
          <li><a data-color="color_4" class="color_4" tabindex="-1">4</a></li>
          <li><a data-color="color_5" class="color_5" tabindex="-1">5</a></li>
          <li><a data-color="color_6" class="color_6" tabindex="-1">6</a></li>
          <li><a data-color="color_7" class="color_7" tabindex="-1">7</a></li>
          <li><a data-color="color_8" class="color_8" tabindex="-1">8</a></li>
          <li><a data-color="color_9" class="color_9" tabindex="-1">9</a></li>
          <li><a data-color="color_10" class="color_10" tabindex="-1">10</a></li>
          <li><a data-color="color_11" class="color_11" tabindex="-1">10</a></li>
          <li><a data-color="color_12" class="color_12" tabindex="-1">12</a></li>
          <li><a data-color="color_13" class="color_13" tabindex="-1">13</a></li>
          <li><a data-color="color_14" class="color_14" tabindex="-1">14</a></li>
          <li><a data-color="color_15" class="color_15" tabindex="-1">15</a></li>
          <li><a data-color="color_16" class="color_16" tabindex="-1">16</a></li>
          <li><a data-color="color_17" class="color_17" tabindex="-1">17</a></li>
          <li><a data-color="color_18" class="color_18" tabindex="-1">18</a></li>
          <li><a data-color="color_19" class="color_19" tabindex="-1">19</a></li>
          <li><a data-color="color_20" class="color_20" tabindex="-1">20</a></li>
          <li><a data-color="color_21" class="color_21" tabindex="-1">21</a></li>
          <li><a data-color="color_22" class="color_22" tabindex="-1">22</a></li>
          <li><a data-color="color_23" class="color_23" tabindex="-1">23</a></li>
          <li><a data-color="color_24" class="color_24" tabindex="-1">24</a></li>
          <li><a data-color="color_25" class="color_25" tabindex="-1">25</a></li>
        </ul>
  </div>
    </div>
<!-- End .background_changer -->
</div>
<!-- /container --> 

<!-- Le javascript
    ================================================== --> 
<!-- General scripts --> 
<script src="js/jquery.js" type="text/javascript"> </script> 
<script src="js/plugins/enquire.min.js" type="text/javascript"></script> 
<script language="javascript" type="text/javascript" src="js/plugins/jquery.sparkline.min.js"></script> 
<script src="js/plugins/excanvas.compiled.js" type="text/javascript"></script> 
<script src="js/bootstrap-transition.js" type="text/javascript"></script> 
<script src="js/bootstrap-alert.js" type="text/javascript"></script> 
<script src="js/bootstrap-modal.js" type="text/javascript"></script> 
<script src="js/bootstrap-dropdown.js" type="text/javascript"></script> 
<script src="js/bootstrap-scrollspy.js" type="text/javascript"></script> 
<script src="js/bootstrap-tab.js" type="text/javascript"></script> 
<script src="js/bootstrap-tooltip.js" type="text/javascript"></script> 
<script src="js/bootstrap-popover.js" type="text/javascript"></script> 
<script src="js/bootstrap-button.js" type="text/javascript"></script> 
<script src="js/bootstrap-collapse.js" type="text/javascript"></script> 
<script src="js/bootstrap-carousel.js" type="text/javascript"></script> 
<script src="js/bootstrap-typeahead.js" type="text/javascript"></script> 
<script src="js/bootstrap-affix.js" type="text/javascript"></script> 
<script src="js/fileinput.jquery.js" type="text/javascript"></script> 
<script src="js/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script> 
<script src="js/jquery.touchdown.js" type="text/javascript"></script> 
<script language="javascript" type="text/javascript" src="js/plugins/jquery.uniform.min.js"></script> 
<script language="javascript" type="text/javascript" src="js/plugins/jquery.tinyscrollbar.min.js"></script> 
<script language="javascript" type="text/javascript" src="js/jnavigate.jquery.min.js"></script> 
<script language="javascript" type="text/javascript" src="js/jquery.touchSwipe.min.js"></script> 
<script language="javascript" type="text/javascript" src="js/plugins/jquery.peity.min.js"></script> 

<!-- Google maps --> 
<script type="text/javascript" src="../../../maps.google.com/maps/api/js@sensor=false"></script> 
<script language="javascript" type="text/javascript" src="js/plugins/gmap3/gmap3.min.js"></script> 

<!-- Custom made scripts for this template --> 
<script src="js/scripts.js" type="text/javascript"></script> 
<script type="text/javascript">
  /**** Specific JS for this page ****/

      $(function(){ // or $(document).ready(function(){
      
       // Address maps
       $("#gmap4").gmap3();
  
        $('#test-ok').click(function(){
          var addr = $('#test-address').val();
          if ( !addr || !addr.length ) return;
          $("#gmap4").gmap3({
            action:   'getlatlng',
            address:  addr,
            callback: function(results){
              if ( !results ) return;
              $(this).gmap3({
                action:'addMarker',
                latLng:results[0].geometry.location,
                map:{
                  center: true,
                  zoom:5
                }
              });
            }
          });
        });
        
        $('#test-address').keypress(function(e){
          if (e.keyCode == 13){
            $('#test-ok').click();
          }
        });

      $("#gmap1").gmap3( {
           options:{
            center:[40.714997,-73.97875],
            zoom: 6,
            mapTypeId: google.maps.MapTypeId.TERRAIN
          }
      });
      $('#gmap2').gmap3(
        { 
        action : 'geoLatLng',
        callback : function(latLng){
          if (latLng){
            $(this).gmap3({
              action: 'addMarker', 
              latLng:latLng,
              map:{
                center: true,
                zoom: 8
                    }
            });
          } else {
            $(this).html('Cannot localise !');
          }
        }
      });

      // Clustered mapsvar cluster;
    
      $(function(){
        $('#gmap3').gmap3({ action: 'init',
          options:{
            center:[46.578498,2.457275],
            zoom: 6,
            mapTypeId: google.maps.MapTypeId.TERRAIN
          },
          callback: function(map){
            waitForBounds(map);
          },
          events:{
            click: function(map, event){
              addMarkerToCluster($(this), event.latLng);
            },
            rightclick: function(map, event){
              addMarkersToCluster($(this), event.latLng);
            }
          }
        });
      });
      
      function waitForBounds(map){
        var ne, sw, bounds = map.getBounds();
        if (!bounds){
          google.maps.event.addListenerOnce(map, 'bounds_changed', 
            function() {
              waitForBounds(map)
            }
          );
          return;
        }
        ne = bounds.getNorthEast();
        sw = bounds.getSouthWest();
        randomMarkers(ne.lat(), sw.lng(), sw.lat(), ne.lng());
      }
      
      function randomMarkers(lat1, lng1, lat2, lng2){
        var i, list = [], rlat=lat2-lat1, rlng=lng2-lng1, lat, lng;
        for(i=0; i<500; i++){
          lat = lat1 + rlat * Math.random();
          lng = lng1 + rlng * Math.random();
          //list.push([lat, lng]);
          list.push({lat:lat, lng:lng, data:i});
        }
        $('#gmap3').gmap3(
          { action: 'addMarkers',
            radius: 100,
            markers: list,
            clusters:{
              // This style will be used for clusters with more than 0 markers
              0: {
                content: '<div class="cluster cluster-1">CLUSTER_COUNT</div>',
                width: 53,
                height: 52
              },
              // This style will be used for clusters with more than 20 markers
              20: {
                content: '<div class="cluster cluster-2">CLUSTER_COUNT</div>',
                width: 56,
                height: 55
              },
              // This style will be used for clusters with more than 50 markers
              50: {
                content: '<div class="cluster cluster-3">CLUSTER_COUNT</div>',
                width: 66,
                height: 65
              }
            },
            callback: function(ref){ // get the cluster reference and save it in global variable
             cluster = ref;
            },
            cluster:{
              events:{
               mouseover: function(cluster, event, data){
                 $(cluster.getDOMElement()).css('border', '1px solid #FF0000');
               },
               mouseout: function(cluster, event, data){
                 $(cluster.getDOMElement()).css('border', '0px');
               }
              }
            }
          }
        );
      }
      
      function addMarkerToCluster($this, latLng){
        $this.gmap3({
          action:'addmarker',
          latLng:latLng,
          to: cluster
        });  
      }
      function addMarkersToCluster($this, latLng){
        var lat = latLng.lat(), 
            lng = latLng.lng(),
            dy = (1/60),
            dx = 1/(60* Math.cos(Math.PI * lat / 180)),
            miles = 15,
            list = [];
        list.push([lat, lng]);
        list.push([lat+miles*dy, lng]);
        list.push([lat-miles*dy, lng]);
        list.push([lat, lng+miles*dx]);
        list.push([lat, lng-miles*dx]);
            
      $this.gmap3({action:'addMarkers', markers:list, to:cluster});
    }



      }); // End maps

      $(document).ready(function() {
      $('[rel=tooltip]').tooltip();
      $('body').css('display', 'none');
      $('body').fadeIn(500);

      $("#logo a, #sidebar_menu a:not(.accordion-toggle), a.ajx").click(function() {
      event.preventDefault();
      newLocation = this.href;
      $('body').fadeOut(500, newpage);
      });
      function newpage() {
      window.location = newLocation;
      }
    });
    

    </script>
</body>
</html>